 #pragma pack_matrix(row_major)

struct vInput {
	float3 position : POSITION;
	float3 normal : NORMAL;
	float2 uv : TEXCOORD;
	float3 tangent : TANGENT;
};

struct vOutput {
	float4 wpos : POSITION;
	float3 normal : NORMAL;
	float2 uv : TEXCOORD;
	float3 tangent : TANGENT;
	float4 pos : SV_POSITION;
};

//Constant buffers when needed
cbuffer SCENE: register(b1){
	float4x4 mView;
	float4x4 mProj;
}

cbuffer OBJECT : register(b0){
	float4x4 mWorld;
}


vOutput main( vInput input )
{
	vOutput output = (vOutput)0;

	float4 pos = float4(input.position, 1);
		pos = mul(pos, mWorld);
	output.wpos = pos;

	pos = mul(pos, mView);
	pos = mul(pos, mProj);

	output.pos = pos;
	output.uv = input.uv;
	output.normal = input.normal;
	output.tangent = input.tangent;

	return output;
}